<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .item{
            height: 15px;
            flex:0 1 20px;
            border:1px solid #ccc;
            margin: 5px;
        }
    </style>
</head>
<body>
    <div style="border:1px solid #ccc;width:130px;display: flex;flex-direction: row;flex-wrap:wrap;padding:5px;">
        <div class="item">1</div>
        <div class="item">1</div>
        <div class="item">1</div>
        <div class="item">1</div>

        <div class="item">1</div>
        <div class="item">1</div>
        <div class="item">1</div>
        <div class="item">1</div>
    </div>
</body>
</html>